package ru.novsu.just_dig;

import ru.novsu.just_dig.screens.SplashScreen;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.FPSLogger;

public class JustDig extends Game {
	// constant useful for logging
	public static final String LOG = JustDig.class.getSimpleName();

	// a libgdx helper class that logs the current FPS each second
	private FPSLogger fpsLogger;
	public SplashScreen getSplashScreen() {
		return new SplashScreen(this);
	}
	@Override
	public void create() {

		Gdx.app.log(JustDig.LOG, "Creating game");
		fpsLogger = new FPSLogger();
		setScreen( getSplashScreen() );
	}

	@Override
	public void resize(int width, int height) {
		super.resize(width, height);
		Gdx.app.log(JustDig.LOG, "Resizing game to: " + width + " x " + height);
	}

	@Override
	public void render() {
		super.render();
		// output the current FPS
		fpsLogger.log();
	}

	@Override
	public void pause() {
		super.pause();
		Gdx.app.log(JustDig.LOG, "Pausing game");
	}

	@Override
	public void resume() {
		super.resume();
		Gdx.app.log(JustDig.LOG, "Resuming game");
	}

	@Override
	public void dispose() {
		super.dispose();
		Gdx.app.log(JustDig.LOG, "Disposing game");
	}
}